package v1

import (
	v1 "api-go/api/v1"
	kugou "api-go/api/v1/kugou"
	kuwo "api-go/api/v1/kuwo"
	migu "api-go/api/v1/migu"
	qq "api-go/api/v1/qq"
	wyy "api-go/api/v1/wyy"
	"api-go/middleware/auth"

	"github.com/gin-gonic/gin"
)

func AddV1Group(r *gin.RouterGroup) {
	v1Group := r.Group("/v1")
	{
		appGroup := v1Group.Group("/app")
		{
			//app更新
			appGroup.GET("/update", v1.AppUpDate)
			//app公告
			appGroup.GET("/notice", v1.AppNotice)
		}
		userGroup := v1Group.Group("/user")
		{
			// 用户注册
			userGroup.POST("/register", v1.UserRegister)

			// 用户登录
			userGroup.POST("/login", v1.UserLogin)

			// 发送邮件
			userGroup.POST("/email", v1.SendEmail)

			//修改密码
			userGroup.POST("/changePass", v1.ChangePasswordByEmail)

			//上传文件
			userGroup.POST("/upload", v1.UserFileUpload)

		}

		// 需要权限
		jwtGroup := v1Group.Group("/")
		jwtGroup.Use(auth.JwtRequired())
		{
			// 查看个人信息
			jwtGroup.GET("/user/me", v1.UserMe)

			// 退出登录
			jwtGroup.POST("/user/logout", v1.UserLogout)

			//跟新用户信息
			jwtGroup.POST("/user/update", v1.UpdateUserInfo)

			//用户上传歌单
			jwtGroup.POST("/user/insertPlaylist", v1.InsertLikePlaylist)

			//用户上传歌曲
			jwtGroup.POST("/user/insertSong", v1.InsertLikeSong)

			//获取用户歌单
			jwtGroup.POST("/user/getPlaylist", v1.GetLikePlaylist)

			//获取用户歌曲
			jwtGroup.POST("/user/getSong", v1.GetLikeSong)

			//删除用户歌单
			jwtGroup.POST("/user/delPlaylist", v1.DeleteAllPlaylist)

			//删除用户歌曲
			jwtGroup.POST("/user/delSong", v1.DeleteAllSong)

			//上传收藏的歌单和歌曲
			jwtGroup.POST("/user/insertLikeList", v1.InsertLikeList)

			//获取收藏的歌单和歌曲
			jwtGroup.POST("/user/getLikeList", v1.GetLikeList)

			//签到
			jwtGroup.POST("/user/daka", v1.Daka)

			//签到连续天数以及积分
			jwtGroup.POST("/user/dakaInfo", v1.DakaInfo)

			//根据年月获取打卡信息
			jwtGroup.POST("/user/dakaInfoByMonth", v1.DakaInfoByMonth)

			//判断今日是否打卡
			jwtGroup.POST("/user/isDakaToday", v1.IsDakaToday)

			//获取歌曲flac地址
			jwtGroup.POST("/user/song/flac", v1.UserSongFlac)
		}

		wyyGroup := v1Group.Group("/wyy")
		{
			//歌曲地址
			wyyGroup.POST("/song", wyy.SongUrl)
			//歌曲详细信息
			wyyGroup.GET("/song/detail", wyy.SongInfo)
			//歌曲歌词
			wyyGroup.GET("/song/lyric", wyy.SongLyric)
			//新歌
			wyyGroup.GET("/song/new", wyy.SongNew)
			//歌单列表
			wyyGroup.GET("/playlist", wyy.PlaylistList)
			//歌曲信息
			wyyGroup.GET("/playlist/detail", wyy.PlaylistInfo)
			//歌曲分类
			wyyGroup.GET("/playlist/cat", wyy.PlaylistCat)
			//歌曲推荐
			wyyGroup.GET("/playlist/recommend", wyy.PlaylistRecommend)
			//搜索
			wyyGroup.GET("/search", wyy.Search)
			//热搜
			wyyGroup.GET("/search/hot", wyy.SearchHot)
			//排行榜信息
			wyyGroup.GET("/top/detail", wyy.TopInfo)
			//排行榜分类
			wyyGroup.GET("/top/cat", wyy.TopCat)
			//首页轮播图
			wyyGroup.GET("/banner", wyy.Banner)
			//mv列表
			wyyGroup.GET("/mv", wyy.MVList)
			//mv信息
			wyyGroup.GET("/mv/detail", wyy.MVInfo)

		}

		qqGroup := v1Group.Group("/qq")
		{
			//歌曲地址
			qqGroup.GET("/song", qq.SongUrl)
			// //歌曲详细信息
			// wyyGroup.GET("/song/detail", wyy.SongInfo)
			//歌曲歌词
			qqGroup.GET("/song/lyric", qq.SongLyric)
			//歌曲最新
			qqGroup.GET("/song/new", qq.SongNew)
			//歌单列表
			qqGroup.GET("/playlist", qq.PlaylistList)
			//歌曲信息
			qqGroup.GET("/playlist/detail", qq.PlaylistInfo)
			//歌曲分类
			qqGroup.GET("/playlist/cat", qq.PlaylistCat)
			//搜索
			qqGroup.GET("/search", qq.Search)
			//热搜
			qqGroup.GET("/search/hot", qq.SearchHot)
			//排行榜信息
			qqGroup.GET("/top/detail", qq.TopInfo)
			//排行榜分类
			qqGroup.GET("/top/cat", qq.TopCat)
			//首页轮播图
			qqGroup.GET("/banner", qq.Banner)
			//mv列表
			qqGroup.GET("/mv", qq.MVList)
			//mv信息
			qqGroup.GET("/mv/detail", qq.MVInfo)
		}

		kuwoGroup := v1Group.Group("/kuwo")
		{
			//歌曲地址
			kuwoGroup.GET("/song", kuwo.SongUrl)
			//歌曲详细信息
			kuwoGroup.GET("/song/detail", kuwo.SongInfo)
			// 歌曲歌词
			kuwoGroup.GET("/song/lyric", kuwo.SongLyric)
			//歌单列表
			kuwoGroup.GET("/playlist", kuwo.PlaylistList)
			//歌单信息
			kuwoGroup.GET("/playlist/detail", kuwo.PlaylistInfo)
			//歌单分类
			kuwoGroup.GET("/playlist/cat", kuwo.PlaylistCat)
			//歌单推荐
			kuwoGroup.GET("/playlist/recommend", kuwo.PlaylistRecommend)
			//搜索
			kuwoGroup.GET("/search", kuwo.Search)
			//热搜
			kuwoGroup.GET("/search/hot", kuwo.SearchHot)
			//排行榜信息
			kuwoGroup.GET("/top/detail", kuwo.TopInfo)
			//排行榜分类
			kuwoGroup.GET("/top/cat", kuwo.TopCat)
			//轮播图
			kuwoGroup.GET("/banner", kuwo.Banner)
			//mv列表
			kuwoGroup.GET("/mv", kuwo.MVList)
			//mv信息
			kuwoGroup.GET("/mv/detail", kuwo.MVInfo)
		}

		kugouGroup := v1Group.Group("/kugou")
		{
			//歌曲地址
			kugouGroup.GET("/song", kugou.SongInfo)
			//歌曲详细信息
			kugouGroup.GET("/song/detail", kugou.SongInfo)
			//最新歌曲
			kugouGroup.GET("/song/new", kugou.SongNew)
			// 歌曲歌词
			// kugouGroup.GET("/song/lyric", kugou.SongLyric)
			//歌单列表
			kugouGroup.GET("/playlist", kugou.PlaylistList)
			//歌曲信息
			kugouGroup.GET("/playlist/detail", kugou.PlaylistInfo)
			//歌曲分类
			kugouGroup.GET("/playlist/cat", kugou.PlaylistCat)
			//导入分享的歌单，并获取歌单歌曲列表
			kugouGroup.GET("/playlist/import", kugou.PlaylistImport)
			//搜索
			kugouGroup.GET("/search", kugou.Search)
			//热搜
			kugouGroup.GET("/search/hot", kugou.SearchHot)
			//排行榜信息
			kugouGroup.GET("/top/detail", kugou.TopInfo)
			//排行榜分类
			kugouGroup.GET("/top/cat", kugou.TopCat)
			//轮播图
			kugouGroup.GET("/banner", kugou.Banner)
			//mv列表
			kugouGroup.GET("/mv", kugou.MVList)
			//mv信息
			kugouGroup.GET("/mv/detail", kugou.MVInfo)
		}

		miguGroup := v1Group.Group("/migu")
		{
			//歌曲地址
			miguGroup.GET("/song", migu.Song)
			// //歌曲详细信息
			// kuwoGroup.GET("/song/detail", kuwo.SongInfo)
			// // 歌曲歌词
			// kuwoGroup.GET("/song/lyric", kuwo.SongLyric)
			// //歌单列表
			// kuwoGroup.GET("/playlist", kuwo.PlaylistList)
			// //歌单信息
			// kuwoGroup.GET("/playlist/detail", kuwo.PlaylistInfo)
			// //歌单分类
			// kuwoGroup.GET("/playlist/cat", kuwo.PlaylistCat)
			// //歌单推荐
			// kuwoGroup.GET("/playlist/recommend", kuwo.PlaylistRecommend)
			// //搜索
			// kuwoGroup.GET("/search", kuwo.Search)
			// //热搜
			// kuwoGroup.GET("/search/hot", kuwo.SearchHot)
			// //排行榜信息
			// kuwoGroup.GET("/top/detail", kuwo.TopInfo)
			// //排行榜分类
			// kuwoGroup.GET("/top/cat", kuwo.TopCat)
			// //轮播图
			// kuwoGroup.GET("/banner", kuwo.Banner)
			// //mv列表
			// kuwoGroup.GET("/mv", kuwo.MVList)
			// //mv信息
			// kuwoGroup.GET("/mv/detail", kuwo.MVInfo)
		}
	}
}
